﻿const express = require('express');
const http = require('http');
const https = require('https');
const fs = require('fs');
const app = express();
app.use(express.static('./'));
// 将两个证书文件读取放到options对象中
// 使用readFileSync()方法，顺序地执行读文件和启动服务操作
const options = {
    key: fs.readFileSync('./ssl/9413236_www.chatgod.cn.key'),
    cert: fs.readFileSync('./ssl/9413236_www.chatgod.cn.pem')
};

// 创建服务器，启动服务器，设置监听端口号
http.createServer(app).listen('80', function () {
  console.log((new Date()) + ' Server is listening on port', 80);
});
